import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  server: {
    open: true,
    proxy: {
      '/api': {
        target: 'http://localhost:9010',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  },
  css:{
    preprocessorOptions:{
      less:{
        javascriptEnabled:true,// 允许链式调用的换行
        modifyVars: {
        	// 主题修改
          "@primary-color": "#fcc800", // 全局主色
        },
      }
    }
  }
})
